package servlet;

import service.UserService;
import service.impl.UserServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/deletAssignUser")
public class DeletAssignUser extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.setCharacterEncoding("utf-8");
        //这里获取的是一个id参数的集合,我是选中框
        String[] ids = request.getParameterValues("uid");
        System.out.println(ids );
        UserService service = new UserServiceImpl();
        service.deleAssignUser(ids);

        //我需要跳转页面 用到重定向
        response.sendRedirect("/day20/findPageUserServlet");
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }
}
